

class MyThread extends Thread {
    @Override
    public void run() {
        System.out.println("hello MyThread");
    }
}

class MyThread1 implements Runnable {

    @Override
    public void run() {
        System.out.println("Hello Runnable");
    }
}


public class TestDemo {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            System.out.println("Hello World");
        });
        t.start();

        System.out.println("Hello Main");
    }
    public static void main4(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("Hello World");
            }
        });
        t.start();

        System.out.println("hello Main");
    }
    public static void main3(String[] args) {
        Thread t = new Thread() {
            @Override
            public void run() {
                System.out.println("hello T");
            }
        };

        t.start();

        System.out.println("hello World");
    }
    public static void main2(String[] args) {
        MyThread thread = new MyThread();
        Thread t = new Thread(thread);
        t.start();

        System.out.println("Hello Main");
    }
    public static void main1(String[] args) {
        Thread thread = new MyThread();

        thread.start();

        System.out.println("hello Main");
    }
}

